package com.lazypeople.domain;

/**
 * 下载配置
 */
public class DownloadSetting {
    private String defaultSavePath;
    private int threadCount;
    private int maxTaskCount;
    private String theme;
    private String language;
    // 最大下载速度（kb/s）
    private int maxDownloadSpeed;

    public DownloadSetting() {
        this.language = "Chinese";
        this.maxDownloadSpeed = 1000;
        this.theme = "default";
    }

    public void setDefaultSavePath(String defaultSavePath) {
        this.defaultSavePath = defaultSavePath;
    }

    public void setThreadCount(int threadCount) {
        if (threadCount <= 0) {
            threadCount = 1;
        }
        if (threadCount > 10) {
            threadCount = 10;
        }
        this.threadCount = threadCount;
    }

    public void setMaxTaskCount(int maxTaskCount) {
        if (threadCount <= 0) {
            threadCount = 5;
        }
        if (threadCount > 10) {
            threadCount = 10;
        }
        this.maxTaskCount = maxTaskCount;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public void setMaxDownloadSpeed(int maxDownloadSpeed) {
        this.maxDownloadSpeed = maxDownloadSpeed;
    }

    public String getDefaultSavePath() {
        return defaultSavePath;
    }

    public int getThreadCount() {
        return threadCount;
    }

    public int getMaxTaskCount() {
        return maxTaskCount;
    }

    public String getTheme() {
        return theme;
    }

    public String getLanguage() {
        return language;
    }

    public int getMaxDownloadSpeed() {
        return maxDownloadSpeed;
    }

}
